package com.sh.transfer;

import com.sh.bean.UserEntity;
import com.sh.dto.UserDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * @Auther: sh
 * @Version 1.0
 * @Description:
 */
@Mapper
public interface  UserTransfer {

    UserTransfer INSTANCE = Mappers.getMapper(UserTransfer.class);

    @Mapping(source = "nameA", target = "nameB")
    UserDTO entityToDto(UserEntity entity);

    @Mapping(source = "nameB", target = "nameA")
    UserEntity dtoToEntity(UserDTO dto);
}

